package cloud.maque.sso.client.utils;

import cloud.maque.common.core.utils.TokenUserUtil;
import cn.dev33.satoken.stp.StpUtil;
import org.springframework.stereotype.Service;

/**
 * 用户会话相关工具
 */
@Service
public class TokenUserImpl implements TokenUserUtil {

    public String GetUserName() {

        if (StpUtil.isLogin()) {
            return (String) StpUtil.getExtra("userName");
        } else {
            return "";
        }
    }
}
